<?php
require_once(dirname(__FILE__)."/../../libs/login/login.php");
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();

if ($mc->Ismp($_POST["Submit"])!="")
{
	if ($_POST["classname"]==""){$mc->msg("类别名称不能为空","go");}
	$classname=$_POST["classname"];
	$content=$_POST["content"];
	 $classorder=$_POST["classorder"];
$sx->addshuxing($tb,$classname,$content,$classorder);
$mc->msg("添加成功","shuxing_class.php?id=".$id."&sx=".$_GET["sx"]."");

}
$path="修改密码";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台管理系统</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#updatepwbtn").click(function(){
		if($("#oldpassword").val()==""){
		alert("旧密码不能为空！");
		return;
	}
	if($("#newpassword1").val()==""){
		alert("新密码不能为空！");
		return;
	}
	if($("#newpassword2").val()==""){
		alert("确认密码不能为空！");
		return;
	}
		if($("#newpassword1").val()!=$("#newpassword2").val()){
		alert("确认密码与新密码不一致！");
		return;
	}
		$.ajax({ 
        type: "POST", 
        url: "../ajax/login_inc.php", 
        dataType: "text", 
        data: {"updpwbtn":true,"oldpassword":$("#oldpassword").val(),"newpassword":$("#newpassword1").val()}, 
        beforeSend: function(){ 
      
        }, 
 success: function(data){
 	//alert(data);
 		 if(data.indexOf("password is wrong")!=-1)
  {
  	 alert("旧密码错误！");
	  return ;
  }else if(data.indexOf("update is ok")!=-1){
  	 alert("修改成功！");
	  return ;
  }else{
  	 alert("修改失败！");
	  return ;
  }
  
 	
 }
		})
		
	})
})
</script>
</head>
<body style="background:#fff"> 
<div class="content">
    <div class="right">
<form name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
          <td width="100%" height="24" class="top_head">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="1%" align="right"  height="45">&nbsp;</td>
                  <td width="99%" >
                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="55%" style="padding-left:20px;padding-top:10px;"><img src="../images/head.gif" width="13" height="11"><b><?php echo $path;?></b></td>
                      <td width="45%" align="right">&nbsp;</td>
                    </tr>
                  </table>
                  </td>
                </tr>
              </table>
          </td>
        </tr>
 </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="liebiao">
  <tr>
    <td width="11%" height="50" align="right">旧密码：</td>
    <td height="50"><input name="oldpassword" type="password" id="oldpassword"  ><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">新密码：</td>
    <td height="50" valign="middle"><input name="newpassword1" type="password" id="newpassword1"><Font>
   </Font></td>
    </tr>
  <tr>
    <td height="50" align="right" valign="middle">确认密码：</td>
    <td height="50" valign="middle"><input name="newpassword2" type="password" id="newpassword2"><Font>
   </Font></td>
    </tr>

  <tr>
    <td height="50" align="right" valign="middle">&nbsp;</td>
    <td height="50" valign="middle"><bdo>
      <input type="button" name="updatepwbtn" value="修改" id="updatepwbtn"> 
    </bdo></td>
    </tr>
    </table>
</form>
</div>
</div>
</body>
</html>
